//
// Created by chizuru on 2025/9/8.
//

#pragma once
#include "IResponseTerminator.h"
#include <functional>

class FunctionResponseTerminator : public IResponseTerminator{
public:
    using Pred = std::function<bool(const std::vector<uint8_t>&)>;
    explicit FunctionResponseTerminator(Pred p) : pred(std::move(p)) {}
    bool isComplete(const std::vector<uint8_t>& a) const override { return pred(a); }
private:
    Pred pred;
};

